From ec90dc4bb93baaa44c7b0f92a425a8d586d8b2ab Mon Sep 17 00:00:00 2001 From: "mwilli2@equilibrium.research" Date: Tue, 29 Mar 2005 00:57:29 +0000 Subject: [PATCH] bitkeeper revision 1.1159.276.1 (4248a7f9-4Jb7VaVyStfIWsk_XitsQ) Make sysrq work. Signed-off-by: --- linux-2.6.11-xen-sparse/arch/xen/kernel/reboot.c | 2 +- tools/python/xen/lowlevel/xu/xu.c | 3 +++ xen/include/public/io/domain_controller.h | 4 ++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/linux-2.6.11-xen-sparse/arch/xen/kernel/reboot.c b/linux-2.6.11-xen-sparse/arch/xen/kernel/reboot.c index 07aae9d0c6..d732070fe4 100644 --- a/linux-2.6.11-xen-sparse/arch/xen/kernel/reboot.c +++ b/linux-2.6.11-xen-sparse/arch/xen/kernel/reboot.c @@ -242,7 +242,7 @@ static void shutdown_handler(ctrl_msg_t *msg, unsigned long id) else if ( (pending_sysrq == -1) && (msg->subtype == CMSG_SHUTDOWN_SYSRQ) ) { - pending_sysrq = msg->msg[0]; + pending_sysrq = ((shutdown_sysrq_t *)&msg->msg[0])->key; schedule_work(&sysrq_work); } else diff --git a/tools/python/xen/lowlevel/xu/xu.c b/tools/python/xen/lowlevel/xu/xu.c index 2c3ee6b33f..79c18795c9 100644 --- a/tools/python/xen/lowlevel/xu/xu.c +++ b/tools/python/xen/lowlevel/xu/xu.c @@ -671,6 +671,9 @@ static PyObject *xu_message_new(PyObject *self, PyObject *args) P2C(mem_request_t, target, u32); P2C(mem_request_t, status, u32); break; + case TYPE(CMSG_SHUTDOWN, CMSG_SHUTDOWN_SYSRQ): + P2C(shutdown_sysrq_t, key, char); + break; } if ( dict_items_parsed != PyDict_Size(payload) ) diff --git a/xen/include/public/io/domain_controller.h b/xen/include/public/io/domain_controller.h index c3494e34ca..58652a530e 100644 --- a/xen/include/public/io/domain_controller.h +++ b/xen/include/public/io/domain_controller.h @@ -545,6 +545,10 @@ typedef struct { /* SHUTDOWN_suspend. */ #define CMSG_SHUTDOWN_SYSRQ 3 +typedef struct { + char key; /* 0: sysrq key */ + char __pad[3]; /* 1: */ +} PACKED shutdown_sysrq_t; /* 4 bytes */ /****************************************************************************** * MEMORY CONTROLS -- 2.30.2